package cn.itcast.com.List;

import java.util.ArrayList;
import java.util.List;

public class Demo01 {
    public static void main(String[] args) {
        /*
        增
        boolean add(E e)
        void add(int index, E element) 0 <= index <= size
        boolean addAll(Collection<? extends E> c)
        boolean addAll(int index, Collection<? extends E> c)
        查
        E get(int index)
        int hashCode()
        int indexOf(Object o)
        List<E> subList(int fromIndex, int toIndex)  瞻前不顾后,subList得到的数据其实还是原来的数据，假如修改sublist就是在修改list
        迭代 继承的，功能更加高级
        ListIterator<E> listIterator()
        删
        E remove(int index)
        改
        E set(int index, E element)
         */
        List list = new ArrayList();
        list.add("hello");
        list.add("world");
        list.add(2,"cskaoyan");
        System.out.println(list);
        Object remove = list.remove(list.size() - 1);

        System.out.println(remove);
        System.out.println(list);
    }
}
